<?php

/**
 * @category   Oos
 * @package    Oos_Search
 * @license    New BSD License
 */


/**
 * @see Zend_Gdata
 */
require_once 'Zend/Gdata.php';
require_once 'Oos/Site/SiteFeed.php';
require_once 'Oos/Site/SiteEntry.php';

/**
 *
 * @category   Oos
 * @package    Oos
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Oos_Search extends Zend_Gdata
{
	protected $_defaultPostUri;
  	protected $_entrypoint;
  	protected $_apiKey;
	protected $_apiSign;
	
    public static $namespaces = array(
		'oos' => 'http://11870.com/api/oos',
		'georss' => 'http://www.georss.org/georss/10',
		'gml' => 'http://www.opengis.net/gml');
		
	public function __construct($client, $entrypoint, $apiKey, $apiSecret)
	{
		$this->registerPackage('Oos_Site');
        $this->registerPackage('Oos_Site_Extension');
        
        $this->_entrypoint = $entrypoint;
        $this->_apiKey = $apiKey;
        $this->_apiSign = md5($apiKey . $apiSecret);
        
		$this->_defaultPostUri = $defaultposturi;
        parent::__construct($client);
	}
	
	/**
     * Retrieves results for a search query
     *
     * @param	$query	Oos_Site_SiteQuery 
     * @return	Oos_Site_SiteFeed
     */
	function getResults($query)
	{
		$feed = parent::getFeed($query, 'Oos_Site_SiteFeed');

		return $feed;
	}
}

?>
